#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
#include<map>

class Solution {
public:
    char firstUniqChar(string s) {
        //第一个只出现一次字母
        map<char,int> M;
        for(int i = 0;i<s.size();++i){
            ++M[s[i]];
        }
        for(int i =0 ;i<s.size();++i){
            if(M[s[i]]==1){
                return s[i];
            }
        }
        return ' ';
    }
};


int main(){
    Solution S;
    cout<<S.firstUniqChar("abaccdeff")<<endl;
}


